<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/16 0016
 * Time: 13:53
 */

namespace Home\Controller;
use Think\Controller;

class AdminsController extends Controller{
    public function __construct(){
        parent::__construct();
        //当前操作
        $nowac = CONTROLLER_NAME.'-'.ACTION_NAME;
        //dump($nowac);exit;
        $name = session('name');
        $pass = session('pass');
//        dump($name);
//        dump($pass);
        $redis = linkredis();
        $redispass = $redis->get('password');
       // dump($redispass);
        $yunxu_ac="Index-index";
        if(($name == null) && ($yunxu_ac != $nowac)){
            $this->redirect('Home/Index/index');
        }
        if(($redispass !== $pass) && ($yunxu_ac != $nowac)){
            $this->redirect('Home/Index/index');
        }
    }

}